package com.solution.admin.product.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.solution.admin.product.dao.ProductSpecCompositionDao;
import com.solution.admin.product.entity.ProductSpecCompositionEntity;
import com.solution.common.dao.impl.BaseDaoImpl;

/**
 * 商品规格值DAO实现
 * 
 * @author xu_cc
 * @date 2017-08-31 23:48:45
 */
@Repository
public class ProductSpecCompositionDaoImpl extends BaseDaoImpl<ProductSpecCompositionEntity> implements ProductSpecCompositionDao {

    /**
     * 保存商品规格值信息
     * 
     * @param productSpecCompositionEntity
     * @return
     * @author xu_cc
     * @date 2017-08-31 23:48:45
     */
    @Override
    public long saveProductSpecComposition(ProductSpecCompositionEntity productSpecCompositionEntity) {
        return super.insert(productSpecCompositionEntity);
    }

    /**
     * 删除商品规格值
     * 
     * @param productSpecCompositionId
     * @return
     * @author xu_cc
     * @date 2017-08-31 23:48:45
     */
    public int deleteByProductId(Long productId) {
        return super.getSessionTemplate().delete("deleteById", productId);
        // return super.deleteById(productId);
    }

    /**
     * 根据条件查询商品规格值
     * 
     * @param param
     * @return
     * @author xu_cc
     * @date 2017-08-31 23:48:45
     */
    @Override
    public List<ProductSpecCompositionEntity> listProductSpecComposition(Map<String, Object> param) {
        return super.listBy(param);
    }
}
